package com.elite.groovy.dev;

import com.elite.groovy.kh.KHUtil;
import net.sf.json.JSONObject;

/**
 * @projectName: ngsapitask-davco
 * @package: com.elite.groovy.dev
 * @className: SocketTest
 * @author: LiJT
 * @description: TODO
 * @date: 2024-04-01 18:46
 * @version: 1.0
 */
public class SocketTest {

    public static void main(String[] args) {
        String socketMsg = "{\"source\":\"SELIET\",\"target\":\"000001\",\"targetType\":0,\"clientType\":\"pc\",\"message\":\"" + KHUtil.getRandomString(4) + "\",\"refid\":\"" + KHUtil.getRandomString(36) + "\",\"module\":\"\"}";

        JSONObject socketJson = JSONObject.fromObject(socketMsg);
        WebSocketClient.pushMessage("ws://127.0.0.1:9100/ngs/ws", socketJson.toString());
    }
}
